import axios from "axios"
//得到所有宠物主
export async function getMaster(value,text,page=1,maxResult=10){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/master',{
        params:{
            value,
            text,
            page,
            maxResult,
        }
    });

    return resp;
}
//删除宠物主
export async function deleteMaster(masterId){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/master',{
        params:{
            method:'delete',
            masterId

        }
    });

    return resp;
}
//添加宠物主
export async function addMaster(master){
    // 使用代理
    var resp = await axios.get('/api/pet_sys/master',{
        params:{
            method:'add',
                masterName:master.masterName,
                masterNickname:master.masterNickname,
                masterTel:master.masterTel,
                masterImager:master.masterImages,
                masterAddress:master.masterAddress,
                masterArea:master.masterArea

        }
    });

    return resp;
}
//修改宠物主
export async function updataMaster(master){
    // 使用代理
    var resp = await axios.get('/api/pet_sys/master',{
        params:{
            method:'update',
                masterId:master.masterId,
                masterName:master.masterName,
                masterNickname:master.masterNickname,
                masterTel:master.masterTel,
                masterImages:master.masterImages,
                masterAddress:master.masterAddress,
                masterArea:master.masterArea

        }
    });

    return resp;
}
//查看单个宠物主
export async function showMaster(masterId){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/master',{
        params:{
            method:'show',
            masterId

        }
    });

    return resp;
}